package com.atguigu.jxc.controller;
import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.SaleList;
import com.atguigu.jxc.service.SaleListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description 供应商Controller控制器
 */
@RestController
@RequestMapping("/saleListGoods")
public class SaleListGoodsController {

	@Autowired
	private SaleListGoodsService saleListGoodsService;

	/**
	 * 下拉查询供应商
	 *
	 * @return
	 */
	//	http://localhost:8080/saleListGoods/save?saleNumber=JH1605768306735
	@RequestMapping("/save")
	//    @RequiresPermissions(value = "供应商管理")
	public ServiceVO save(SaleList saleList, String saleListGoodsStr) {
		return saleListGoodsService.save(saleList, saleListGoodsStr);
	}

	@RequestMapping("/list")
	//    @RequiresPermissions(value = "供应商管理")
	public Map<String, Object> list(String saleNumber, Integer supplierId, Integer state, String sTime, String eTime) {
		return saleListGoodsService.list(saleNumber, supplierId, state, sTime, eTime);
	}

	@RequestMapping("/goodsList")
	//    @RequiresPermissions(value = "供应商管理")
	public Map<String, Object> goodsList(Integer saleListId) {
		return saleListGoodsService.goodsList(saleListId);
	}

	@RequestMapping("/delete")
	//    @RequiresPermissions(value = "供应商管理")
	public ServiceVO delete(Integer saleListId) {
		return saleListGoodsService.delete(saleListId);
	}


	@RequestMapping("/updateState")
	//    @RequiresPermissions(value = "供应商管理")
	public ServiceVO updateState(Integer saleListId) {
		return saleListGoodsService.updateState(saleListId);
	}


	@RequestMapping("/count")
	//    @RequiresPermissions(value = "供应商管理")
	public String count(String sTime, String eTime ,Integer goodsTypeId, String codeOrName){
		return saleListGoodsService.count(sTime, eTime, goodsTypeId, codeOrName);
	}

	@RequestMapping("/getSaleDataByDay")
	//    @RequiresPermissions(value = "供应商管理")
	public String getSaleDataByDay(String sTime, String eTime){
		return saleListGoodsService.getSaleDataByDay(sTime, eTime);
	}






}
